#include<stdio.h>
#include <limits.h>
/**
 *  991-2015 六.7
 */

wordlength( )
{ int i;
    unsigned int v= ~0;                          /* 将各二进制位置初值 */
    printf("max int = %d\n", v);                              
    for(i=1; (v=v>>1)>0; i++);                        /* 统计二进制位数 */
    return(i);
}

wordlength_num( int v)
{ int i;
    for(i=1; (v=v>>1)>0; i++);                        /* 统计二进制位数 */
    return(i);
}

int square(int x, int y){
    if(y == 0){
        return 1;
    }else if(y == 1){
        return x;
    }else{
        return x * square(x, y -1);
    }
}

int main(){
    int length = wordlength();
    printf("max=%d\n", length);
    for(int i=0;i< 10;i++){
        int s = square(2, i);
        printf("%d 's bit num = %d\n", s - 1, wordlength_num(s - 1));

    }
}